export default function myPlugin() {
  const virtualFileId = '@my-virtual-file'

  return {
    name: 'my-plugin', // 必须的，将会显示在 warning 和 error 中
    resolveId(id) {
      console.log('%c 🍷 id: ', 'font-size:20px;background-color: #42b983;color:#fff;', id)
      if (id === virtualFileId) {
        return virtualFileId
      }
    },
    load(id) {
        console.log('%c 🍠 id: ', 'font-size:20px;background-color: #3F7CFF;color:#fff;', id)
      if (id === virtualFileId) {
        return `export const msg = "from virtual file"`
      }
    },
  }
}
